package com.baymax.test.scene.view

import android.graphics.*
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable

/**
 * @title:       标题
 * @project:     TestScene
 * @package:     com.baymax.test.scene.view
 * @class:       ReflectDrawable
 * @description:
 * <p>
 * 类描述
 * </p>
 *
 * @version:   1.0
 * @createDate:   2023/5/8 12:42
 * @Copyright (C) 2023 YSTEN
 * @author:       xuyujian
 */
class ReflectDrawable(val d: BitmapDrawable) : DrawableWrapper(d) {
    private val pc = Picture()

    val dp = Paint()
    val oW = 96
    val oH = 96
    var scale = 1f
    val mp = Paint().apply {
        shader = LinearGradient(
            0f, 0f, oW.toFloat(), oH.toFloat(),
            0x77ffffff, 0x00ffffff, Shader.TileMode.CLAMP
        )
    }


    override fun onBoundsChange(bounds: Rect) {

    }


    override fun draw(canvas: Canvas) {
        //mirror
        canvas.drawPicture(pc)

    }
}